<?php /*a:1:{s:67:"F:\ruinuo\new_lowcode\/app/common/template\ruinuo\design\lists.html";i:1714450502;}*/ ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表设计</title>
    <link rel="stylesheet" href="/static/component/pear/css/pear.css"/>
    <link rel="stylesheet" href="/static/component/pear/css/module/design.css"/>
    <script src="/static/component/layui/layui.js"></script>
    <script src="/static/component/pear/pear.js"></script>
    <script src="/static/component/pear/module/ruinuo/sortable.js"></script>
    <script src="/static/component/pear/module/ruinuo/xm-select.js"></script>
    <script src="/static/component/pear/module/ruinuo/code.js"></script>
</head>
<body>
<style>
    .design_head {
        width: 100%;
        height: 50px;
        overflow: hidden;
        line-height: 50px;
        border-bottom: 1px solid #eee
    }

    .design_head .title {
        font-size: 16px;
        font-weight: 500;
        padding: 12px 18px;

    }

    .design_head .menu {
        text-align: center
    }

    .design_head .menu li {
        text-align: center;
        position: relative;
        cursor: pointer;
        font-size: 14px;
        line-height: 50px;
        padding-left: 15px;
        padding-right: 15px;
        transition-duration: .25s, 1s;
    }

    .design_head .menu li.on, .design_head .menu li:hover {
        background: var(--theme_color);
        color: #fff;

    }

    .design_head .menu li i {
        padding-right: 5px;
        font-size: 20px;
    }

    .nodata {
        margin-top: 100px;
        text-align: center;
        line-height: 30px;
        cursor: pointer;
    }

    .nodata i {
        display: block;
        font-size: 40px !important;
        padding-bottom: 15px;
    }

</style>


<div class="view_body"></div>
<script type="text/html" id="view_body_data">
    <div class="design_head display_flex">
        <div class="flex_1 title">列表设计器</div>
        <div class=" display_flex menu">
            <li class="on display_flex">
                <i class="ruinuo-icon icon-biaodan"></i>列表
            </li>
            <li onclick="FileCode()" class="display_flex">
                <i class="ruinuo-icon icon-ccaozuo"></i>生成
            </li>
            <li onclick="layui.public.DrawerTpl('.mode_list','300px','模块类别')" class="display_flex">
                <i class="ruinuo-icon icon-menu"></i>模块
            </li>
        </div>
        <div class="flex_1">
        </div>
    </div>
    <div class="design-con">
        <section class="design-left">
            <div class="design-title">列表菜单</div>
            <div class="display_flex" style="padding: 10px">
                <button onclick="layui.design_table.OpenAdd(1);" type="button" class="pear-btn pear-btn-primary flex_1">
                    <i class="ruinuo-icon icon-add-select"></i>新增菜单
                </button>

            </div>
            {{# if(d.table.length === 0){ }}
            <div class="nodata" onclick="layui.public.DrawerTpl('.mode_list','300px','模块类别')">
                <i class="ruinuo-icon icon-meiyoushuju"></i>
                请先选择模块
            </div>
            {{# } else { }}
            <div class="layui-menu" style="margin: 10px;margin-top: 0px">
                <input class="ruinuo_more_dropdown_data" type="hidden"
                       value="[{title:'修改',open:'window',url:'/ruinuo/lists/edit/?id={id}'},{title:'复制',open:'ajax',url:'/ruinuo/design.lists/menucopy/?id={id}'},{title:'删除',open:'ajax',url:'/ruinuo/lists/delete/?id={id}'}]">
                <ul>
                    {{# layui.each(d.table, function(iindex, iitem){ }}
                    <li data-id="{{iitem.id}}" data-mode="tablefind" data-onclick="layui.design_table.Init();"
                        onclick="layui.public.DrawerClick(this);">
                        <div class="layui-menu-body-title">{{iitem.name}}</div>
                        <div class="ruinuo_more ruinuo-icon icon-elipsis"></div>
                    </li>
                    {{# }); }}
                </ul>


            </div>
            {{# } }}


        </section>
        <section class="design-center ">
            <div class="layui-tab layui-tab-brief design-tab">
                <ul class="layui-tab-title">
                    <li class="layui-this" onclick="layui.design_table.Design(1);">显示设置</li>
                    <li onclick="layui.design_table.Design(2);">按钮设置</li>
                </ul>
                <div class="layui-tab-content" style="padding:10px">
                    <div class="layui-tab-item layui-show design_table_elem">
                        <table id="design_table_elem" lay-filter="design_table_elem"></table>
                    </div>
                </div>
            </div>

        </section>
    </div>

</script>
<div style="display: none" class="view_mode_list"></div>
<script type="text/html" id="view_mode_list_data">
    <div class="mode_list">
        <div class="layui-card-body">
            <div class="layui-menu">
                <div class="inputdiv">
                    <i class="layui-icon layui-icon-search"></i>
                    <input type="text" autocomplete="off" class="layui-input ruinuo_drawer_search"
                           placeholder="输入关键词检索">
                </div>
                {{# layui.each(d.modelist, function(index, item){ }}
                <li lay-options="{type: 'group'}" class="layui-menu-item-group layui-menu-item-up">
                    <div class="layui-menu-body-title" style="font-weight: bold;color:#000;">
                        {{item.name}}<i class="layui-icon layui-icon-down"></i>
                    </div>
                    <ul>
                        {{# layui.each(item.children, function(iindex, iitem){ }}
                        <li data-id="{{iitem.id}}" data-mode="table" onclick="layui.public.DrawerClick(this);">
                            <div class="layui-menu-body-title">{{iitem.name}}</div>
                        </li>
                        {{# }); }}
                    </ul>
                </li>
                {{# }); }}
            </div>
        </div>
    </div>
</script>
<!--S选择字段-->

<div style="display:none;">
    <div class="field-layer-right">
        <div class="layui-card-header">选择字段<i class="layui-icon layui-icon-close fieldbtnClose"
                                              style="float:right; cursor:pointer" title="关闭"></i></div>
        <div class="layui-card-body layui-form" style="overflow-y:auto; height:92vh">
            <table class="layui-table layui-table-filed" lay-skin="line" style="border-width:0px; margin-top:0px">
                <thead>
                <tr>
                    <th align="left">选择</th>
                    <th align="left">字段编码</th>
                    <th align="left">字段名称</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td align="center"></td>
                    <td align="center"></td>
                    <td align="center"></td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>

<!--E选择字段-->

<script>
    var $ = layui.jquery;
    var config = [];
    let SettingData = {};
    let SeleteData = {};
    let raw = '';
    let menu_code = '';
    layui.use(['design_table', 'form', 'http', 'public'], function () {
        layui.design_table.Init();
    })

    function SelectAction(res = [], field = '') {
        if (field == "field") {
            var text = res.arr[0].text || '';
            $(".design-right-con input[name='title']").val(text);
        }
        setTimeout("layui.design_form.UpJson()", 100);
    }

    function CheckboxAction() {
        layui.form.on('checkbox(checkbox_filter)', function (data) {
            layui.design_form.UpJson();
        })
    }

    function RadioAction() {
        layui.form.on('radio(radio_filter)', function (data) {
            layui.design_form.UpJson();
        })
    }

    function SwitchAction() {
        layui.form.on('switch(SwitchField)', function (data) {
            layui.design_form.UpJson();
        })
    }

    function TableAction(id = '') {
        layui.design_form.UpJson();
    }

    function SearchLoad(elem = '', type = '') {
        layui.design_table.Init();
    }

    function FileCode() {
        let GetConfig = layui.design_table.GetConfig();
        let modeid = GetConfig.modeid || 0;
        if (modeid == 0) {
            layer.msg('请先选择模块', {icon: 2});
            layui.public.DrawerTpl('.mode_list', '300px', '模块类别');
            return false;
        }
        layui.http.SendAjax('/ruinuo/mode/filecode/', {id: modeid}, [], function (res) {
            if (res.code == 200) {
                layer.msg('生成成功', {icon: 1});
            } else {
                layer.msg(res.msg, {icon: 2});
            }
        })
    }


</script>
</body>
</html>
